package bsh.dyn;

import org.objectweb.asm.MethodVisitor;

import bsh.CompilationState;
import bsh.exception.CompilationFailedException;

/**
 * {@link Transformation} that can be JIT compiled
 * 
 * @author takeshi
 */
public interface CompilableTransformation extends Transformation {

    int SCRIPT_HELPER_INDEX = 1;

    int METHOD_CALL_TARGET_INDEX = 2;

    int METHOD_CALL_PARAMETERS_INDEX = 3;

    /**
     * Compiles the transformation
     * 
     * @param visitor {@link MethodVisitor}
     * @param state {@link CompilationState}
     * @throws CompilationFailedException e
     */
    void compile(MethodVisitor visitor, CompilationState state) throws CompilationFailedException;

}
